import Vue from 'vue'
import Vuex from 'vuex'
import tagsView from './modules/tagsView'

Vue.use(Vuex)

const store= new Vuex.Store({
  state: {
      userInfo:JSON.parse(window.sessionStorage.getItem("userInfo"))|| {},
    },
    mutations:{
      setUserInfo(state,userInfo){
        window.sessionStorage.setItem('userInfo', JSON.stringify(userInfo));//将传递的数据先保存到localStorage中
        state.userInfo = userInfo;// 之后才是修改state中的状态
      }
    },
  actions: {
  },
  modules: {
    tagsView,
  }
})
export default store
